package com.qingcheng.controller.comment;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.entity.PageResult;
import com.qingcheng.entity.Result;
import com.qingcheng.pojo.comment.ReportLog;
import com.qingcheng.service.comment.ReportLogService;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@RestController
@RequestMapping("/reportLog")
public class ReportLogController {

    @Reference
    private ReportLogService reportLogService;

    @GetMapping("/findAll")
    public List<ReportLog> findAll(){
        return reportLogService.findAll();
    }

    @GetMapping("/findPage")
    public PageResult<ReportLog> findPage(int page, int size){
        return reportLogService.findPage(page, size);
    }

    @PostMapping("/findList")
    public List<ReportLog> findList(@RequestBody Map<String,Object> searchMap){
        return reportLogService.findList(searchMap);
    }

    @PostMapping("/findPage")
    public PageResult<ReportLog> findPage(@RequestBody Map<String,Object> searchMap,int page, int size){
        return  reportLogService.findPage(searchMap,page,size);
    }

    @GetMapping("/findById")
    public ReportLog findById(String id){
        return reportLogService.findById(id);
    }


    @PostMapping("/add")
    public Result add(@RequestBody ReportLog reportLog){
        reportLogService.add(reportLog);
        return new Result();
    }

    @PostMapping("/update")
    public Result update(@RequestBody ReportLog reportLog){
        reportLogService.update(reportLog);
        return new Result();
    }

    @GetMapping("/delete")
    public Result delete(String id){
        reportLogService.delete(id);
        return new Result();
    }

}
